package com.heaven1949.tmall.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 网关服务启动类
 *
 * @author zhangjian
 * @date 2023-03-13 14:49:24
 */
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = "com.heaven1949.tmall")
public class TmallGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(TmallGatewayApplication.class, args);
    }

//    @Bean
//    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
//        return builder.routes()
//                .route("product-server", r -> r.path("/api/product/**")
//                        .uri("lb://product-server"))
//                .route("order-server", r -> r.host("/api/order/**")
//                        .uri("lb://order-server"))
//                .build();
//    }

}